/*
 *@description  路由守卫
 * @author yx
*/
import router from '../index'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
router.beforeEach((to, from, next) => {
  NProgress.configure({ showSpinner: false }) // 去掉右侧加载圆圈
  if (from.path === '/') {
    NProgress.start()
    setTimeout(() => {
      next()
    }, 120)
  } else {
    next()
  }
})
router.afterEach(() => {
  NProgress.done()
})
